package xfg.策略模式;

import java.util.HashMap;
import java.util.Map;

public class Main {
    static Map<String,Class<? extends ICouponDiscount>> map = new HashMap<>();

    static {
        map.put("MJ", MJCouponDiscount.class);
    }
    public static void main(String[] args) throws InstantiationException, IllegalAccessException {
         // 通过反射获得到具体的策略类的实列
        Context context=new Context(map.get("MJ").newInstance());
        context.getCouponDiscount();
        String s = "hello world";
    }
}
